/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package modelo;
import java.io.Serializable;
import java.sql.Time;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
/**
 *
 * @author Elias Mendoza
 */
@Entity
@Table(name="sensor_registro")
public class SensorRegistro implements Serializable{
  @Id
  @GeneratedValue(strategy= GenerationType.IDENTITY)
  private int id;
  @Column(nullable=false)
  private Time hora;
  @Column(name="A",nullable=false)
  private float a;
  @Column(name="B",nullable=false)
  private float b;
  @Column(name="C",nullable=false)
  private float c;
  @Column(name="D",nullable=false)
  private float d;
  @Column(name="E",nullable=false)
  private float e;
  @Column(name="F",nullable=false)
  private float f;
  @Column(name="G",nullable=false)
  private float g;
  @Column(name="H",nullable=false)
  private float h;
  @Column(name="I",nullable=false)
  private float i;
  @Column(name="J",nullable=false)
  private float j;
  @Column(name="K",nullable=false)
  private float k;
  @Column(name="L",nullable=false)
  private float l;
  @Column(name="M",nullable=false)
  private float m;
  @Column(name="N",nullable=false)
  private float n;
  @Column(name="O",nullable=false)
  private float o;
  @Column(name="P",nullable=false)
  private float p;
  //Establecemos la relacion de muchos a uno (muchos registros sensor en un historial)
  @JoinColumn(name="id_historial",referencedColumnName="id",nullable=false)
  @ManyToOne()
  private Historial historial;

  public SensorRegistro() {
  }

  public SensorRegistro(int id) {
    this.id = id;
  }
  

  public float getA() {
    return a;
  }

  public void setA(float a) {
    this.a = a;
  }

  public float getB() {
    return b;
  }

  public void setB(float b) {
    this.b = b;
  }

  public float getC() {
    return c;
  }

  public void setC(float c) {
    this.c = c;
  }

  public float getD() {
    return d;
  }

  public void setD(float d) {
    this.d = d;
  }

  public float getE() {
    return e;
  }

  public void setE(float e) {
    this.e = e;
  }

  public float getF() {
    return f;
  }

  public void setF(float f) {
    this.f = f;
  }

  public float getG() {
    return g;
  }

  public void setG(float g) {
    this.g = g;
  }

  public float getH() {
    return h;
  }

  public void setH(float h) {
    this.h = h;
  }

  public Historial getHistorial() {
    return historial;
  }

  public void setHistorial(Historial historial) {
    this.historial = historial;
  }

  public Time getHora() {
    return hora;
  }

  public void setHora(Time hora) {
    this.hora = hora;
  }

  public float getI() {
    return i;
  }

  public void setI(float i) {
    this.i = i;
  }

  public int getId() {
    return id;
  }


  public float getJ() {
    return j;
  }

  public void setJ(float j) {
    this.j = j;
  }

  public float getK() {
    return k;
  }

  public void setK(float k) {
    this.k = k;
  }

  public float getL() {
    return l;
  }

  public void setL(float l) {
    this.l = l;
  }

  public float getM() {
    return m;
  }

  public void setM(float m) {
    this.m = m;
  }

  public float getN() {
    return n;
  }

  public void setN(float n) {
    this.n = n;
  }

  public float getO() {
    return o;
  }

  public void setO(float o) {
    this.o = o;
  }

  public float getP() {
    return p;
  }

  public void setP(float p) {
    this.p = p;
  }

  @Override
  public String toString() {
    return "SensorRegistro{" + "id=" + id + ", hora=" + hora + ", a=" + a + ", b=" + b + ", c=" + c + ", d=" + d + ", e=" + e + ", f=" + f + ", g=" + g + ", h=" + h + ", i=" + i + ", j=" + j + ", k=" + k + ", l=" + l + ", m=" + m + ", n=" + n + ", o=" + o + ", p=" + p + ", historial=" + historial + '}';
  }

  @Override
  public boolean equals(Object obj) {
    if (obj == null) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    final SensorRegistro other = (SensorRegistro) obj;
    if (this.id != other.id) {
      return false;
    }
    if (this.historial != other.historial && (this.historial == null || !this.historial.equals(other.historial))) {
      return false;
    }
    return true;
  }

  @Override
  public int hashCode() {
    int hash = 7;
    hash = 89 * hash + this.id;
    hash = 89 * hash + (this.historial != null ? this.historial.hashCode() : 0);
    return hash;
  }

  
}
